package com.az.miaoapi.response;

import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import lombok.Data;

@Data
public class ResponseResult {
    private final Integer code;
    private final String msg;
    private final JSONObject data;

    public ResponseResult(ResponseCode responseCode, Object data) {
        this.code = responseCode.getCode();
        this.msg = responseCode.getMsg();
        this.data = JSONUtil.parseObj(data);
    }




    public ResponseResult(ResponseCode responseCode) {
        this.code = responseCode.getCode();
        this.msg = responseCode.getMsg();
        this.data = JSONUtil.parseObj(null);
    }


}
